import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    header: [],
    name: '123'
  },
  mutations: {
    /**初始化页面数据 */
    init(state, payload) {
      Object.keys(state).forEach(key => {
        state[key] = payload[key]
      })
    },
    headerData(state, data) {
      state.header = data
    }
  }
})
